<template>
    <div class="home">
        <div>HelloWorld</div>
        <van-button @click="encryptMet" type="primary">加密</van-button>
        <van-button @click="decryptMet" type="primary">解密</van-button>
        <van-button @click="rabbitmqMet" type="primary">rabbit刷新</van-button>
        <div>{{ encryptStr }}</div>
        <div class="">{{ decryptStr }}</div>
    </div>
</template>

<script>
import { TestMock,testEncrypt, decrypt,rabbitmq } from "../service/getData.js";
export default {
    data() {
        return {
            //index:0
            useStr: "8007",
            encryptStr: "",
            decryptStr: "",
        };
    },
    components: {},
    mounted() {
        console.log(window.g);
        this.initData();
    },
    methods: {
        initData(){
            TestMock().then(res => {
                console.log(res);
            })
        },
        encryptMet() {
            testEncrypt(this.useStr)
                .then((res) => {
                    this.encryptStr = res;
                })
                .catch((error) => {});
        },
        decryptMet() {
            decrypt(this.encryptStr)
                .then((res) => {
                    this.decryptStr = res;
                })
                .catch((error) => {});
        },
        rabbitmqMet(){
            rabbitmq("").then(res => {

            }).catch(error => {

            })
        }
    },
};
</script>
<style lang="less">
.home {
    .px2rem(font-size,24px);
}
</style>